﻿﻿

<!--********************* Part1:Jsp Head *********************-->

<%@page import="com.hitrust.gs.util.date.DateUtil"%>

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/framework/head.jsp"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.ArrayList"%>

<!--********************* Part2:Java Code *********************-->
<%
	ProductOutCategorySearchEvent event = (ProductOutCategorySearchEvent) context
				.getSessionValue("ProductOutCategorySearchEvent");
    ProductOutCategory p= event.getPoc();
	ObjectList list = p.search(con, event);
%>
<%@ page import="com.hitrust.gs.service.*"%>
<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<%@page import="system.LoginContext"%>


<script language=javascript>
var list_code = "listProductOutCategory";
function doSearch()
{
    SetValue("s_ProductCode",GetValue("i_ProductCode")); //集中编码
    SetValue("s_ProductName",GetValue("i_ProductName")); //产品名称
    SetValue("s_Spec",GetValue("i_Spec")); //规格
    SetValue("s_Model",GetValue("i_model")); //型号
    SetValue("s_OutCategory",GetValue("i_OutCategory")); //出库分类
    doCommonSearch();
}

function doExcel(){
    <%if (list.getTotalSize() > 20000) {%>
        alert("导出EXCEL产品数量不能超过20000条！");
        return false;
    <%} else {%>
    SetAction("exportProductOutCategory");
    frm.submit();
    <%}%>
}
function addInfos()
{
  window.open("<%= response.encodeURL(request.getContextPath() + "/A1900011.do")%>");
}

key_InitDefault();
key_RegSubmitHandler(doSearch);


</script>
<%=uiBody%>>

<%@ include file="/framework/menu.jsp"%>

<!--********************* Part4:Form  ***************-->
<form id=frm name='pager' action="<%=Config.getSrv()%>" method="post">
<input type="hidden" name='indexs'>
<input type="hidden" name='confirmorreject'>
<input type=hidden name="action_code" value=""> <input type=hidden
	name="Id" value=""> <input type=hidden name=sortOrder value="">
 <input type=hidden name="s_ProductCode"
	value="<%=event.getPoc().getProductCode()%>"> <!--集中编码-->
 <input type=hidden name="s_ProductName"
	value="<%=event.getPoc().getProductName()%>"> <!--产品名称--> <input
	type=hidden name="s_Spec" value="<%=event.getPoc().getSpec()%>"> <!--规格-->
<input type=hidden name="s_Model" value="<%=event.getPoc().getModel()%>">
<input type=hidden name="s_OutCategory"
	value="<%=event.getPoc().getOutCategory()%>"> <!--状态-->   
	

<%@ include file="/framework/list_head.jsp"%> <br>
<!--********************* Part5:Search Area ***************--> <%=uiSearchStart%>>
<%
 	int key_tab = 1;
 %>
 <%=uiSearchInputTR%>><%=uiSearchInputTDHead%>> 集中编码：&nbsp;&nbsp; <input type="text"
	class="texts" name="i_ProductCode" size="20"
	value="<%=event.getPoc().getProductCode()%>" key_tab="<%=key_tab++%>">
&nbsp;&nbsp;&nbsp;&nbsp;产品名称：&nbsp;&nbsp;&nbsp;&nbsp; <input type="text"
	class="texts" name="i_ProductName" size="20" value="<%=event.getPoc().getProductName()%>"
	key_tab="<%=key_tab++%>">
</td>
</tr>
 <%=uiSearchInputTR%>><%=uiSearchInputTDHead%>> 
	规&nbsp;&nbsp;&nbsp;&nbsp;格：&nbsp;&nbsp;
<input type="text" class="texts" name="i_Spec" size="20"
	value="<%=event.getPoc().getSpec()%>" key_tab="<%=key_tab++%>">
&nbsp;&nbsp;&nbsp;&nbsp;型&nbsp;&nbsp;&nbsp;&nbsp;号：&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" class="texts"
	name="i_Model" size="20" value="<%=event.getPoc().getModel() %>"
	key_tab="<%=key_tab++%>">

</td>
</tr>
 <%=uiSearchInputTR%>><%=uiSearchInputTDHead%>> 分类：&nbsp;&nbsp;
 <select name="i_OutCategory">
		<option value="">---全部---</option>
			<%
		ArrayList statusList = (ArrayList) request.getAttribute("outCategoryList");
		String status = request.getParameter("i_OutCategory");
		if (statusList != null && statusList.size() > 0) {
			for (int i = 0; i < statusList.size(); i++) {
				String[] temp = (String[]) statusList.get(i);
				if (status != null && status.equals(temp[0])) {
					%>
			<option value="<%=temp[0]%>" selected><%=temp[1]%></option>
			<%} else {
					%>
			<option value="<%=temp[0]%>"><%=temp[1]%></option>
			<%
				}
			}
		}

		%>
		</select>
	
	<input type="button" value="查询" class="buttons"
	onclick="doSearch();return false;"><input type="button"
	value="清空" class="buttons" onclick="doClearEvent();return false;">
</td>
</tr>


<%=uiSearchEnd%> <!--列表标题--> <%=UIManager.addListHeadTitle("产品列表")%> <!--********************* Part6:List Area ***************-->

<%=uiListStart%>> <%@ include file="/framework/list_foot.jsp"%>

<%
	int index = 1;
%> <%=uiListHeadTR%>> 
<%=UIManager.addListHead("集中编码", index++)%>
<%=UIManager.addListHead("产品名称", index++)%> 
<%=UIManager.addListHead("规格", index++)%>
<%=UIManager.addListHead("型号", index++)%> 
<%=UIManager.addListHead("分类", index++)%>
<%=UIManager.addListHead("单位", index++)%>
<%=uiListHeadTREnd%>> <!--data-->


 <%
 	for (int i = 0; i < list.size(); i++) {
 			ProductOutCategory obj = (ProductOutCategory) list.get(i);
 %> <%=uiListDataTR[i % 2]%> align=center> 

<%
	Product cmd = Product.fetch(con,
					obj.getProductId());
%>
<%=uiListDataTD%>><%=cmd.viewConcentricityCode(con)%></td>
<%=uiListDataTD%>><%=cmd.viewName(con)%></td>
<%=uiListDataTD%>><%=cmd.viewSpec(con)%></td>
<%=uiListDataTD%>><%=cmd.viewModel(con)%></td>
<%=uiListDataTD%>><%=obj.getOutCategory()%></td>
<%=uiListDataTD%>><%=cmd.viewProductUnit(con)%></td>
</tr>
<%
	}
%> <%@ include file="/framework/list_foot2.jsp"%>

<%=uiListEnd%> <!--********************* Part7:Action Area ***************-->
<%=uiCommandStart%>> <%=uiCommandTR%>> <%=uiCommandTD%>>



<input type=button value="　　批量导入　　" class="buttons"
	onclick="addInfos();">
<input type=button value="　　导出EXCEL　　" class="buttons"
	onclick="doExcel();return false;">
</td>
</tr>
<%=uiCommandEnd%></form>
<script language=javascript>

</script>
<%@ include file="/framework/foot.jsp"%>

<!--
    Author    :wzh
    FileName  :/system/base/ProductOutCategoryList.jsp
-->
